<?php use_helper('Text') ?>
<?php use_helper('Date') ?>
<?php use_javascript('space_gh') ?>
<?php use_javascript('pic_show/index') ?>
<?php use_javascript('pic_show/show') ?>
<?php use_javascript('pic_show/slide_show') ?>


<?php slot('title', "$contestant - ") ?>
<?php slot('area', "{$area}赛区") ?>
<!--Content-->
<div class="sp_main">
    <div class="sp_top"><img src="/images/space_top.gif" /></div>
    <div class="sp_left">
      <div class="sp_left1">
          <img src="<?php printf(sfConfig::get('app_path_contestant_image'),$contestant->getImage()) ?>" width="220" height="310" alt="<?php echo $contestant ?>" />
          <div class="sp_left_btn1"><?php echo $contestant->getHits() ?> 票</div>
		  <div class="sp_left_btn2 show click_me">
		  <label for="poll_log_contestant_id_<?php echo $contestant->getId() ?>">
		  <a href="#poll_log_contestant_id_<?php echo $contestant->getId() ?>">为她加油</a>
		  </label>
		  </div>
      </div>
	 <div id="poll-form">
        <form method="post" id="poll" action="<?php echo url_for('@contestant_show_poll?id=' . $sf_request->getParameter('id')) ?>">
          <?php echo $form->renderGlobalErrors() ?>
          <?php echo $form['contestant_id']->renderError() ?>
          <?php echo $form->renderHiddenFields() ?>
          <div>为<?php echo $form['contestant_id'] ?>投一票<input type="submit" value="确定" /></div>
        </form>
     </div>
       <div class="sp_left2">
          <ul>
             <li><span>姓名</span> <?php echo $contestant ?></li>
             <li><span>编号</span> <?php echo $contestant->getNumber() ?></li>
             <li><span>赛区</span> <?php echo $contestant->getArea() ?>赛区</li>
             <li><span>身高</span> <?php echo $contestant->getApplication()->getHeight() ?>公分</li>
             <li><span>体重</span> <?php echo $contestant->getApplication()->getWeight() ?>公斤</li>
             <li><span>三围</span> <?php echo $contestant->getApplication()->getBwh() ?></li>
             <li><span>来自</span> <?php echo $contestant->getApplication()->getNativePlace() ?></li>
          </ul>
       </div>
	   <!--
       <div class="sp_left_mc">当前名次</div>
       <div class="sp_left_pm">
          <ul>
             <li>河北总决赛<span>亚军</span>8847票</li>
             <li>河北半决赛<span>20强</span>6565票</li>
             <li>河北预选赛<span>50强</span>4545票</li>
          </ul>
       </div>
	   -->
	</div>
    <div class="sp_center">
      <div class="sp_right">
          <!--Photos Start-->
          <div class="sp_right_photos" id="my-photo">
             <span class="ft18">我的照片</span>
             <div class="sp_right_photos_zs1 current-photo">
			 <?php if (count($contestant->getPictures())): ?>
  			 <?php $i = 0 ?>
             <?php foreach ($contestant->getPictures() as $picture): ?>
                <p class="current-photo"><img src="<?php 
                printf(sfConfig::get('app_path_contestant_picture'), $picture->getPicture()) 
              ?>" id="picture-<?php echo ++$i ?>" alt="信息提示" /></p>
			 <?php endforeach ?>
			 <?php endif ?>                
             </div>
             <div class="sp_right_photos_zs2 thumb-list">
			 <?php if (count($contestant->getPictures())): ?>
               <ul class="space-photo-list slide-show-content">
			   <?php $i = 0 ?>
               <?php foreach ($contestant->getPictures() as $picture): ?>
                 <li><a href="#picture-<?php echo ++$i ?>"><img src="<?php 
                    printf(sfConfig::get('app_path_contestant_picture_thumb'), $picture->getThumb())
                  ?>" width="125" height="100" alt="thumb"  /></a></li>
               <?php endforeach ?>
               </ul>
			   <?php endif ?>
               <div class="clear"></div>
               <div class="sp_right_next next slide-show left"><a href="#right"><img src="/images/space_next.gif" /></a></div>
               <div class="sp_right_pre next slide-show right"><a href="#left"><img src="/images/space_pre.gif" /></a></div>
            </div>
        </div>
          <!--Photos Over-->
          
         <div class="sp_right_js">
             <span class="ft18">我的介绍</span>
             <ul>
                <?php echo simple_format_text($contestant->getApplication()->getIntroduction()) ?>
             </ul>
          </div>
          
          <div class="sp_right_sp">
             <span class="ft18">我的视频</span>
			 <?php if(!count($vcrs)){echo "<ul><li>暂时没有视频</li></ul>";}?>
			 <?php foreach ($vcrs as $vcr): ?>
             <ul>
                <li><a href="<?php echo url_for('@vcr_show?id=' . $vcr->getId()) ?>"><img src="<?php printf(
                    sfConfig::get('app_path_vcr_thumb'),
                    $vcr->getThumb()
                  ) ?>" alt="thumb" /></a></li>
             </ul>
			 <?php endforeach ?>
             <div class="clear"></div>
          </div>
          
          <div class="sp_right_ly">
             <span class="ft18">留言</span>
              <table width="610" cellspacing="0" class="sp_right_ly1" id="table">
                <?php $n = count($messages); for ($i = 0; $i < $n; $i++): ?>
				<tr<?php ($i + 1) % 2 and print ' class="odd"' ?>>
                  <td>
                    <em><?php echo format_date($messages[$i]->getCreatedAt(), 'y-M-d h:m') ?></em>
                    <span><?php echo $messages[$i]->getName() ?>:</span>
                    <p><?php echo simple_format_text($messages[$i]->getMessage()) ?></p>
                  </td>
                </tr>
				<?php endfor ?>
            </table>
        </div>
        
        <div class="all_ms"><a href="<?php echo url_for('@contestant_showallmessage?cid='.$sf_params->get('id')) ?>">查看所有留言</a></div>
        <div class="sp_right_title">
           <span>我要留言</span>

           <div class="clear"></div>
        </div>
        <?php include_partial('Message/form', array(
          'form' => $form2,
          'contestantId' => $sf_params->get('id')
        )) ?>
      </div>
    </div>
    <div class="sp_bottom"><img src="/images/space_bottom.gif" /></div>
</div>